Transactional updating in dynamic distributed workloads

ABSTRACT

A workload manager is operable with a distributed transaction processor having a plurality of processing regions and comprises: a transaction initiator region for initiating a transaction; a transaction router component for routing an initiated transaction to one of the plurality of processing regions; an affinity controller component for restricting transaction routing operations to maintain affinities; the affinity controller component characterised in comprising a unit of work affinity component operable with a resource manager at the one of the plurality of processing regions to activate an affinity responsive to completion of a recoverable data operation at the one of the plurality of processing regions.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is the national stage of PCT/EP2010/070631 filed Dec.23, 2010, designating, inter alia, the United States and claimingpriority to European Patent Application having Patent Application No.10150461.1 filed Jan. 11, 2010, each of which is hereby incorporated byreference.

BACKGROUND

The concept of dynamic workload management of user applications has beenknown in the art for many years. Fundamentally, it consists ofidentifying where individual pieces of work should be dispatched-to froma candidate set of servers based upon server state, an appropriaterouting algorithm and any relevant affinity data. Candidate sets areusually defined via administrative dialogs related to user applications.Routing algorithms are typically throughput or response time based.Affinities refer to data that the application references in the targetserver, which needs to be subsequently accessed, thus impeding theability to dynamically route work whilst the affinity is active.

Distributing applications has the advantage that, should an individualserver fail, only those currently executing tasks on that server areaffected; user tasks on other servers are unaffected, thus reducing theimpact of the failure on application availability. Users executing workon the failed server must manually restart their transactions, and thetransactions must be routed to another (active) candidate for theapplication to execute.

Such solutions provide increased availability of applications to endusers whilst the availability of the underlying individual servers maychange. They also can improve throughput and application response timessmoothing the effects across multiple address spaces.

One implementation of a dynamic workload management system, for IBM'sCICS® Transaction Server, is provided by the CICSPlex SM WorkloadManagement (WLM) component. This component is invoked by CICS atsuitable points in processing requests to identify the target region forthe request, and to manage application affinities. (CICS is a trademarkof IBM Corporation, registered in many jurisdictions).

Dynamic workload distribution schemes can further be complicated by theeffects of parts of the work being included in what is known in the artof transaction processing as a Unit Of Work (UOW). The concept oftransactional units of work is well known to those of ordinary skill inthe transaction processing art, and thus needs no further descriptionhere. Examples considered in the present description relate to IBM'sDB2® database records and IBM's VSAM records accessed in the targetregions, but it will be clear to one of ordinary skill in the art thatthe same considerations apply to records or other data controlled usingother resource management systems that are capable of interacting with atransaction processing system. (DB2 is a trademark of IBM Corporation,registered in many jurisdictions).

When a unit of work is distributed across multiple servers, a recoverymanager must make a note of any server within the unit of work that hasperformed recoverable work on its behalf. This information is used atsuccessful completion (syncpoint commit) to commit those pieces of workin the servers, or to back out the changes (syncpoint rollback) shouldthe application request it, should the task terminate abnormally(abend), or should the region terminate abnormally (at region restart).As is known to those of skill in the art, the more distributed the unitof work, the more processing is required and the greater is the risk ofa component not being available. It is further well known that multiplerequests for the same record within a unit of work must be within thesame server region, otherwise a deadlock occurs, and that applicationsthat will request the same record outside that unit of work, when aretained lock exists (caused by either a task abend or a server abend),will not be able to execute.

Also, once a target region has been selected for a piece of work with adeclared affinity, the affinity is bound and subsequent requests will berouted to that region, regardless of whether any recoverable work hasbeen done in the target region. This is particularly disadvantageous toprocessing efficiency when the target region rejects the request,unnecessarily reducing application availability, and causing unnecessarybackouts when a chain of distributed program links (DPLs) is involvedand one program in the chain abends.

It is desirable to address these shortcomings of known transactionprocessing systems wherein the conflicting needs for transactionalcontrol of dynamically-routed work requests and affinity management ofthe work requests cannot be reconciled other than partially, and bymeans of expensive and potentially error-prone application and systemredesign.

BRIEF SUMMARY

The present invention accordingly provides, in a first aspect, workloadmanager operable with a distributed transaction processor having aplurality of processing regions and comprising: a transaction initiatorregion for initiating a transaction; a transaction router component forrouting an initiated transaction to one of said plurality of processingregions; an affinity controller component for restricting transactionrouting operations to maintain affinities; said affinity controllercomponent characterised in comprising a unit of work affinity componentoperable with a resource manager at said one of said plurality ofprocessing regions to activate an affinity responsive to completion of arecoverable data operation at said one of said plurality of processingregions.

In a second aspect, there is provided a method for operating a workloadmanager with a distributed transaction processor having a plurality ofprocessing regions and comprising: initiating a transaction by atransaction initiator region; routing an initiated transaction by atransaction router component to one of said plurality of processingregions; restricting transaction routing operations by an affinitycontroller component to maintain affinities; the method characterised incomprising operating unit of work affinity component with a resourcemanager at said one of said plurality of processing regions to activatean affinity responsive to completion of a recoverable data operation atsaid one of said plurality of processing regions.

In a third aspect, there is provided a computer program comprisingcomputer program code to, when loaded into a computer system andexecuted thereon, cause said computer system to perform all the steps ofthe method according to the second aspect.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

A preferred embodiment of the present invention will now be described byway of example only, with reference to the accompanying drawings, inwhich:

FIG. 1A shows the operation of a system according to the prior art;

FIG. 1B shows further operation of a system according to the prior art;

FIG. 2A shows yet further operation of a system according to the priorart; and

FIG. 2B shows the operation of a system according to a preferredembodiment of the present invention.

DETAILED DESCRIPTION

One or more aspects of the present invention relate to the control ofdynamic distributed workloads in transaction processing systems, andmore particularly to the provision of improved control of such workloadswhere transactions are affected by transactional affinities.

As described in the Background, dynamic routing of requests in atransactional environment with known techniques for affinity managementcan cause application deadlocks and excessive distribution of syncpointflows.

This occurs because, in the known art embodiments of affinitymanagement, the affinity must be declared to the system prior to anyactivity that might modify the recoverable resources that are subject tothe need for the affinity actually having taken place.

In its broadest application, a preferred embodiment of the presentinvention provides a Unit Of Work affinity control component operablewith the transaction processor dynamic routing logic to address theseshortcomings of the known art.

Preferred embodiments of the present invention address theseshortcomings by providing a “provisional” declaration of an affinitybetween a UOW and a server that owns the resources, but not “activating”the affinity until a recoverable modification to a resource has takenplace.

Thus, in the preferred embodiment, dynamic routing to provide serverallocation is available the first time a routing request is performed(RouteSelect). Once recoverable work has been done (recorded by recoverymanager—Create Affinity), subsequent routing requests will be directedto the same server (Affinity active) until the UOW is either committedor backed out (Destroy affinity). For the purposes of illustrating themain idea, the following description treats this affinity as if it werea declared affinity according to the art.

Should no recoverable work have been done in the target region, then afurther transaction having the same “provisional” affinity can bedynamically routed to an alternative region to perform its part of theprocessing without user intervention, because the affinity is not“fixed” as in the prior art. This reduces the potential effects ofconventional affinity management on the performance of the system asperceived by the end user by automatically retrying routing to analternate server when no recoverable work has been performed at thetarget.

Upon first dynamic routing request (routeSelect), upon successful route,record that fact for this unit of work (in the resource manager).Subsequent routing requests will be directed to that region, untilcommit/backout processing, thereby preventing deadlocks. Typicalexamples today include VSAM and DB2 record locks.

Turning to FIG. 1A, there is shown an arrangement of transactionprocessing components according to the art comprising a first system orregion 100 arranged for receiving an inbound request for work and havinga dynamic routing component 170 arranged to route work to furthersystems or regions 110, 120 for processing by programs (exemplaryprograms named PROG A and PROG B, in the Figure) 130, 140. Programs 130,140 are operable to access a resource, for example, data resource 150,which comprises an exemplary data record (called r5 in the Figure) 160.As will be clear to one of ordinary skill in the art, inbound requestsfor transactional work cause the initiation of a UOW, which has a scopeshown by the broken-line enclosure marked UOW SCOPE. In an exemplaryflow, inbound request 1 causes dynamic routing flow 2 to route therequest to program 130 (PROG A) at system or region 130. At flow 3, PROGA accesses resource r5 160 at data resource 150. At flow 4, a furtherdynamic routing flow occurs to program 140 (PROG B) at system or region120. At flow 5, PROG B attempts to access resource r5 160 at dataresource 150. A deadlock ensues. It is to prevent such occurrences thatthe system of affinity management as shown in FIG. 1B was developed,

Turning now to FIG. 1B, inbound request 1 causes dynamic routing flow 2to route the request to program 130 (PROG A) at system or region 130. Atflow 3, PROG A accesses resource r5 160 at data resource 150. Anaffinity exists, so that at flow 4, a further work request isconstrained to invoke program 130 (PROG A) at system or region 110. Atflow 5, PROG A accesses resource r5 160 at data resource 150.Advantageously, the locks on resource r5 160 are local and thus nodeadlock occurs. Disadvantageously, however, the affinity has restrictedthe system's freedom to route work and thus reduced the system'sprocessing efficiency.

In a preferred embodiment of the present invention, then, a new form ofaffinity is defined. Like any other affinity, it is declared to exist,but it is not made effective until the first recoverable work has beendone by the transaction. The following exemplary pseudocode illustratesthe procedure with reference to the CICS and CICSPlex SM products, butit will be clear to one of ordinary skill in the art that the inventionmay be embodied in many other transactional environments, including, forexample, database transaction systems and online transaction processingsystems:

CICSPlex SM Select(routingType)  When (routeSelect)  If DeclaredAffinitythen  If AffinityActive then  GetAffinity  RouteToTarget  Else SelectTarget  CreateAffinity  RouteToTarget  Else   SelectTarget  RouteToTarget ... ... CreateAffinity: proc If DeclaredAffinity = UOWthen  NotifyRMUOWAffinity(Target) .. .. End

CICSRouting: If Dynamic = YES then  If UOWAFFINITY then  InvokeRouteStatic (Target)  Else   InvokeRouteSelect

UOWProcessing: CommitComplete: If UOWAffinity then  UOWAFFINITY = falseEnd

As will be clear to one of skill in the art, embodiments of theinvention are particularly advantageous in allowing the system to makeuse of the circumstance in which no recoverable work has been done torespond to a route reject or failure by automatically selecting anothertarget region without user intervention.

In FIG. 2A, inbound request 1 causes dynamic routing flow 2 to PROG A130 at system or region 110. The routing request is rejected or there isan abnormal termination at 3, and at 4 the request fails. In systemsaccording to the art, a manual restart to redirect the routing action toavoid the affinity would be required. Otherwise, the affinity wouldcause repeated retries using the same (failing) route.

By contrast, as shown in FIG. 2B, a system according to the preferredembodiment responds to the route rejection or abnormal termination at 3by performing a test at 4 to determine whether the UOW affinity has beenactivated by the performance of recoverable work. If the UOW affinityhas not been activated, the system is free to route the work at 5 toPROG B 140 at system or region 120, and processing of the work canproceed.

The following exemplary pseudocode illustrates the procedure withreference to the CICS and CICSPlex SM products, but it will be clear toone of ordinary skill in the art that the invention may be embodied inmany other transactional environments, including, for example, databasetransaction systems and online transaction processing systems:

CICSPlex SM Routing Select(routingType)  When (routeSelect)  SelectTarget   RouteToTarget When routeReject or (routeAbend andNoWorkDone) then  SelectTarget  RouteToTarget ...

CICSRouting: if Abend then If recoverableWork then InvokeRouteAbend(NoWorkdone = false) Else InvokeRouteAbend (NoWorkDone = true)

It will be readily appreciated by one of ordinary skill in the art thatvarious further modifications to the embodiment described above will beapparent to a person of ordinary skill in the art.

It will be clear to one skilled in the art that the method of thepresent invention may suitably be embodied in a logic apparatuscomprising logic means to perform the steps of the method, and that suchlogic means may comprise hardware components or firmware components.

It will be appreciated that the method described above may also suitablybe carried out fully or partially in software running on one or moreprocessors (not shown), and that the software may be provided as acomputer program element carried on any suitable data carrier (also notshown) such as a magnetic or optical computer disc. The channels for thetransmission of data likewise may include storage media of alldescriptions as well as signal carrying media, such as wired or wirelesssignal media.

The present invention may suitably be embodied as a computer programproduct for use with a computer system. Such an implementation maycomprise a series of computer readable instructions either fixed on atangible medium, such as a computer readable medium, for example,diskette, CD-ROM, ROM, or hard disk, or transmittable to a computersystem, via a modem or other interface device, over either a tangiblemedium, including but not limited to optical or analogue communicationslines, or intangibly using wireless techniques, including but notlimited to microwave, infrared or other transmission techniques. Theseries of computer readable instructions embodies all or part of thefunctionality previously described herein.

Those skilled in the art will appreciate that such computer readableinstructions can be written in a number of programming languages for usewith many computer architectures or operating systems. Further, suchinstructions may be stored using any memory technology, present orfuture, including but not limited to, semiconductor, magnetic, oroptical, or transmitted using any communications technology, present orfuture, including but not limited to optical, infrared, or microwave. Itis contemplated that such a computer program product may be distributedas a removable medium with accompanying printed or electronicdocumentation, for example, shrink-wrapped software, pre-loaded with acomputer system, for example, on a system ROM or fixed disk, ordistributed from a server or electronic bulletin board over a network,for example, the Internet or World Wide Web.

The present invention accordingly provides, in a first aspect, workloadmanager operable with a distributed transaction processor having aplurality of processing regions and comprising: a transaction initiatorregion for initiating a transaction; a transaction router component forrouting an initiated transaction to one of said plurality of processingregions; an affinity controller component for restricting transactionrouting operations to maintain affinities; said affinity controllercomponent characterised in comprising a unit of work affinity componentoperable with a resource manager at said one of said plurality ofprocessing regions to activate an affinity responsive to completion of arecoverable data operation at said one of said plurality of processingregions.

Preferably, said unit of work affinity component is further operable topermit said transaction router component to reroute a transaction to adifferent one of said plurality of processing regions responsive to anindication of lack of completion of a recoverable data operation at saidone of said plurality of processing regions. Preferably, said lack ofcompletion of a recoverable data operation at said one of said pluralityof processing regions is associated with a routing rejection or anabnormal transaction termination. Preferably, said distributedtransaction processor comprises an online transaction processing system.Preferably, said distributed transaction processor comprises atransactional database system.

In a second aspect, there is provided a method for operating a workloadmanager with a distributed transaction processor having a plurality ofprocessing regions and comprising: initiating a transaction by atransaction initiator region; routing an initiated transaction by atransaction router component to one of said plurality of processingregions; restricting transaction routing operations by an affinitycontroller component to maintain affinities; the method characterised incomprising operating unit of work affinity component with a resourcemanager at said one of said plurality of processing regions to activatean affinity responsive to completion of a recoverable data operation atsaid one of said plurality of processing regions.

The method preferably further comprises operating said unit of workaffinity component to permit rerouting a transaction to a different oneof said plurality of processing regions responsive to an indication oflack of completion of a recoverable data operation at said one of saidplurality of processing regions. Preferably, said lack of completion ofa recoverable data operation at said one of said plurality of processingregions is associated with a routing rejection or an abnormaltransaction termination. Preferably, said distributed transactionprocessor comprises an online transaction processing system. Preferably,said distributed transaction processor comprises a transactionaldatabase system.

In a third aspect, there is provided a computer program comprisingcomputer program code to, when loaded into a computer system andexecuted thereon, cause said computer system to perform all the steps ofthe method according to the second aspect.

The invention claimed is:
 1. A method of operating a workload managerwith a distributed transaction processor having a plurality of regions,comprising: initiating a transaction; routing the initiated transactionto one of the plurality of processing regions; declaring a provisionalaffinity between a unit of work for the initiated transaction and theprocessing region to which the initiated transaction is routed;performing, by the processing region to which the initiated transactionis routed, a recoverable data operation; activating, based uponcompletion of the recoverable data operation, the provisional affinity;wherein the recoverable data operation is a recoverable modification toa resource accessed by the processing region to which the initiatedtransaction is routed; and routing, prior to the recoverable dataoperation being perform, a second transaction having a same provisionalaffinity to an alternative one of the plurality of processing regions.